API Documentation
Static Public Member Functions | List of all members
nkImages::PixelFormatUtils Class Referencefinal

Utility class to translate enum values into linked useful data. More...

Static Public Member Functions

static PIXEL_FORMAT getRgbFromBgrFormat (PIXEL_FORMAT format)
 
static unsigned int getFormatByteSize (PIXEL_FORMAT format)
 
static bool isFormatCompressed (PIXEL_FORMAT format)
 
static bool isFormatFloatingPoint (PIXEL_FORMAT format)
 
static bool hasAlpha (PIXEL_FORMAT format)
 
static float halfToFloat (unsigned short half)
 

Detailed Description

Utility class to translate enum values into linked useful data.

Member Function Documentation

◆ getRgbFromBgrFormat()

static PIXEL_FORMAT nkImages::PixelFormatUtils::getRgbFromBgrFormat ( PIXEL_FORMAT  format)
static

Provides an RGB format its BGR format equivalent, if available.

Parameters
formatThe format to convert.
Returns
The BGR equivalent of format provided if available, the format if unavailable.

◆ getFormatByteSize()

static unsigned int nkImages::PixelFormatUtils::getFormatByteSize ( PIXEL_FORMAT  format)
static

Translates a pixel format into its byte size, if it were to be tightly packed.

Parameters
formatThe format value to retrieve the size from.
Returns
The format size, in bytes.

◆ isFormatCompressed()

static bool nkImages::PixelFormatUtils::isFormatCompressed ( PIXEL_FORMAT  format)
static

Allows to check if a format is considered as compressed.

Parameters
formatThe format to check.
Returns
Whether the format is compressed (true) or not (false).
Remarks
Compressed formats are for now the BCx variants.

◆ isFormatFloatingPoint()

static bool nkImages::PixelFormatUtils::isFormatFloatingPoint ( PIXEL_FORMAT  format)
static

Allows to check if a format is using floating point values.

Parameters
formatThe format to check.
Returns
Whether the format is using floating point numbers (true) or not (false).

◆ hasAlpha()

static bool nkImages::PixelFormatUtils::hasAlpha ( PIXEL_FORMAT  format)
static

Allows to check if a format has an alpha channel.

Parameters
formatThe format to check.
Returns
Whether the format has an alpha channel (true) or not (false).

◆ halfToFloat()

static float nkImages::PixelFormatUtils::halfToFloat ( unsigned short  half)
static

Converts a 2-byte packed half float value into a readable 4-byte float.

Parameters
halfThe value to convert.
Returns
The floating point equivalent value.

The documentation for this class was generated from the following file: